package impl

import (
	"io/fs"
	"io/ioutil"
	"mime/multipart"
	"os"
)

type FileSystem struct{}

func urlToLocal(url string) string {

	return ""
	//http://124.221.212.162:8080/
}
func localToUrl(path string) string {
	return ""
}
func getStoreRootPath() string {
	return ""
}

func (file FileSystem) StoreWithGroup(multipart *multipart.FileHeader, group string) string {
	//TODO implement me
	filename := multipart.Filename
	open, err := multipart.Open()
	defer open.Close()
	if err != nil {
		return ""
	}
	all, err := ioutil.ReadAll(open)
	err = ioutil.WriteFile(getStoreRootPath()+"/"+group+"/"+filename, all, fs.ModePerm)

	return ""
}

func (file FileSystem) Store(multipart *multipart.FileHeader) string {
	//TODO implement me

	return ""
}

func (file FileSystem) GetAllFileWithGroup(group string) []os.File {
	//TODO implement me
	return nil
}

func (file FileSystem) RemoveFile(url string) bool {
	//TODO implement me
	return false
}

func (file FileSystem) RemoveGroup(group string) bool {
	//TODO implement me
	return false
}

func (file FileSystem) RemoveFileWithGroup(url string, group string) bool {
	//TODO implement me

	return false
}
